<p>我是TOdolist组件</p>
<h2>toDoList</h2>
<div class="totolist-box">
  <p>
    <input type="text" placeholder="请输入待办事项" [(ngModel)]="newToDo" (keydown)="enterBtn($event)">
    <button (click)="handleAdd()" >添加</button></p>
  <ul>
    <li class="li-title"> * 待办事项 * </li>
    <li *ngFor="let item of doList ,let i =index" class="li-item">
      <input 
      type="checkbox" 
      name="doTing" 
      id="" 
      [(ngModel)]="item.state" 
      (click)="changeStateDone(item.text)"
      >{{item.text}} 
      <span (click)="delData(i,item.state)">删除</span>
    </li>
    
    <li class="li-title"> * 已办事项 * </li>
    <li *ngFor="let item of doneList ,let i =index" class="li-item done-item">
      <input 
      type="checkbox" 
      name="doneTing" 
      id="" 
      [(ngModel)]="item.state" 
      (click)="changeStateNotDo(item.text)"
      >{{item.text}} 
      <span (click)="delData(i,item.state)">删除</span>
    </li>
    
  </ul>
</div>
